stdlib: Add missing Psych methods and exception classes#2850
Open
marcoroth wants to merge 2 commits intoruby:masterfrom
Open
stdlib: Add missing Psych methods and exception classes#2850marcoroth wants to merge 2 commits intoruby:masterfrom
marcoroth wants to merge 2 commits intoruby:masterfrom
Conversation
3c68128 to
6ed90f1
Compare
soutaro
requested changes
Feb 16, 2026
Member
soutaro
left a comment
There was a problem hiding this comment.
Thanks!
Can you add test cases for the safe_load_file and unsafe_load_file in test/stdlib/psych_test.rb? The tests for safe_load method should be a good example.
Author
|
Thanks for the review @soutaro! 🙏🏼 I just added tests for both |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds missing type declarations for Psych:
Methods
Psych.safe_load_file- Safely loads YAML from a filePsych.unsafe_load_file- Loads YAML from a file (unsafe)Exception Classes
Psych::SyntaxError- Raised on YAML syntax errorsPsych::Exception- Base exception classPsych::BadAlias- Raised for alias errorsPsych::DisallowedClass- Raised when loading disallowed classesMotivation
These methods and classes are commonly used but were missing from the stdlib declarations, causing type errors in projects using
YAML.safe_load_fileor rescuingPsych::SyntaxError.